package Ch4;

/**
 * Created by Cai Ye on 2016/3/25.
 */
public class OceanWorld4Ocean {
    public static void main(String[] args) {
        doSwim(new OceanWorld1Anemonefish("尼莫"));
        doSwim(new OceanWorld1Shark("兰尼"));
        doSwim(new SwimPlayer("贾斯汀"));
        doDive(new OceanWorld4Submarine("黄色一号"));
        doSwim(new OceanWorld4Seaplane("空军零号"));
        doSwim(new OceanWorld3FlyingFish("甚平"));
        doSwim(new OceanWorld4Boat("方舟"));
        doFly(new OceanWorld4Helicopter("黑鹰"));

    }

    private static void doDive(OceanWorld4Submarine diver) {
        diver.dive();
    }

    private static void doFly(OceanWorld4Helicopter flyer) {
        flyer.fly();
    }


    static void doSwim(OceanWorld1Swimmer swimmer) {
        swimmer.swim();
    }
}
